package com.bigknow.appstore.common;

/**
 * Fusion Checked异常
 */
public class AppStoreException extends Exception {

    private static final long serialVersionUID = 4693756291663151643L;

    public AppStoreException(String message) {
        super(message);
    }

    public AppStoreException(String message, Throwable cause) {
        super(message, cause);
    }

    private AppStoreException(String message, Throwable cause, Object o) {
        super(message, new AppStoreWrapperException(cause));
    }

    public AppStoreException(Throwable cause) {
        super("", cause);
    }

    public AppStoreException toWrapException() {
        Throwable cause = getCause() == this ? null : getCause();
        if (cause == null) {
            return this;
        } else {
            AppStoreException e = new AppStoreException(getMessage(), cause, null);
            e.setStackTrace(this.getStackTrace());
            return e;
        }
    }
}
